<div id="container">
	<div class="shell">		
		
		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>
			
			<!-- Content -->
			<div id="content">
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">Loại Sản phẩm</h2>
						<!--
						<div class="right">
							<label>Tìm kiếm</label>
							<input type="text" class="field small-field" />
							<input type="submit" class="button" value="Tìm" />
						</div>
						-->
					</div>
					<!-- End Box Head -->	

					<!-- Table -->
					<div class="table">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<th width="13">#</th>
								<th>Tiêu đề</th>
								<th>Ẩn/hiện</th>
								<th width="110" class="ac">Chức năng</th>
							</tr>
							
							
							
							<?php
							$basepaging = '';
							// $where='';
							// if(isset($_GET['sections']) && $_GET['sections']!=0){
								// $basepaging .= "&sections=".$_GET['sections'];
								// $where .= ' AND sectionid='.$_GET['sections'];
							// }
							
							// if(isset($_GET['catid'])  && $_GET['catid']!=0){
								// $basepaging .= "&catid=".$_GET['catid'];
								// $where .= ' AND catid='.$_GET['catid'];
							// }
						
							
							$number=20;
							if(isset($_GET['start'])){
								$start=$_GET['start'];
							}else{
								$start=0;
							}
							
												
							// if($ordering){
								// $ordering= "ORDER BY $ordering";
							// }else{
								// $ordering='ORDER BY id DESC';
							// }
							$sqlnum="select id from dm_sanpham_loai ";
							$sql="select * from dm_sanpham_loai ORDER BY id DESC LIMIT $start, $number";
							$querynum=mysql_query($sqlnum);
							$totalnumber= mysql_num_rows($querynum);
							$query=mysql_query($sql);	
							
							// $value=array();
							// $value['query']=$query;
							// $value['number']=$number;
							// echo "<pre>";
							// print_r($query);
							// echo "</pre>";
							
							$i=0;
							while($mn=mysql_fetch_array($query))
							{
								if($i % 2==0)
								{
									$trclass="odd";
								}else{
									$trclass="";
								}
								$i++;
							?>
							<tr class="<?php echo $trclass?>">
								<td><?php echo $i;?></td>
								<td><h3><a href="?action=sanpham_loai_sua&id=<?php echo $mn['id']?>"><?php echo $mn['title']?></a></h3></td>
								<td align="center" valign="middle">
									<?php if($mn['state']==1)
									{
										echo "<img src='images/bat.png'/>";
									}else{
										echo "<img src='images/tat.png'/>";
									}
									?>
									
								</td>
								<td><a onclick="return confirm('Bạn có chắc chắn muốn xóa không !!! ');" href="?action=sanpham_loai_xoa&id=<?php echo $mn['id']?>" class="ico del">Xóa</a><a href="?action=sanpham_loai_sua&id=<?php echo $mn['id']?>" class="ico edit">Sửa</a></td>
							</tr>
							<?php
								
								//echo  $mn['title'];
							}
							?>						
							
						</table>
						<div class="pagging">
							<div class="left">Tổng: <?php echo $totalnumber?></div>
							<div class="right">
							<?php
							
							$base_url ='?action=sanpham_loai'.$basepaging.'&';
							$pagintion = HamhaydungLibs::pagenav($base_url, $start, $totalnumber, $number);
							echo $pagintion;
							?>					

							</div>
						</div>
						<!-- End Pagging -->
						
					</div>
					<!-- Table -->
					
				</div>
				<!-- End Box -->
						

			</div>
			<!-- End Content -->
			
			<!-- Sidebar -->
			<div id="sidebar">
				
				<!-- Box -->
				<div class="box">
					
					<!-- Box Head -->
					<div class="box-head">
						<h2>Quản Lý</h2>
					</div>
					<!-- End Box Head-->
					
					<div class="box-content">
						<a href="?action=sanpham_loai_sua&id=0" class="add-button"><span>Thêm loại sản phẩm</span></a>
						<div class="cl">&nbsp;</div>				
						
					</div>
				</div>
				<!-- End Box -->
			</div>
			<!-- End Sidebar -->
			
			<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>